#include "SQLException.h"

using namespace std;
using namespace mysql;

string SQLException::buildErrorMessage(const string &message, unsigned int error_code, const string &sql_state) {
    ostringstream oss;
    oss << "SQLException: " << message
        << " Error Code: " << error_code
        << ", SQL State: " << (sql_state.empty() ? "N/A" : sql_state);
    return oss.str();
}